p = {
    a: require('crypto-js')
};

F = function (e) {
    var n = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {};
    if (e && "string" === typeof e) {
        var t = n.text || "0"
            , a = n.length || 24;
        if (e.length < a)
            for (var r = e.length; r < a; r++)
                e += t;
        else
            e = e.substring(0, a);
        return e
    }
};

H = function (e) {
    var n = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : ""
        , t = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : {}
        , a = t.enc
        , r = void 0 === a ? "Utf8" : a
        , c = t.mode
        , i = void 0 === c ? "ECB" : c
        , o = t.padding
        , u = void 0 === o ? "Pkcs7" : o
        , d = p.a.enc[r].parse(n)
        , l = {
        mode: p.a.mode[i],
        padding: p.a.pad[u]
    }
        , s = p.a.TripleDES.encrypt(e, d, l);
    return s.toString();
};


K = function () {
    var e = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : "";
    return e.replace(/\s+/g, "");
};


T = function () {
    var e, n, t = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : 32,
        a = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : 16,
        r = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz".split(""), c = [];
    if (a = a || r.length,
        t)
        for (e = 0; e < t; e++)
            c[e] = r[0 | Math.random() * a];
    else
        for (c[8] = c[13] = c[18] = c[23] = "-",
                 c[14] = "4",
                 e = 0; e < 36; e++)
            c[e] || (n = 0 | 16 * Math.random(),
                c[e] = r[19 === e ? 3 & n | 8 : n]);
    return c.join("")
}
var CryptoJS = require('crypto-js')

o = function () {
    return function (text) {
        return CryptoJS.MD5(text).toString()
    }
}

// n = (new Date).getTime()
// a = T()
// t = "s54zv9bm1vd5czfujy6nnuxj1l4g2ny6"
// comParam_curTime = n
// comParam_seqCode = a
// comParam_signature = o()(n + a + o()(a + t + n))

// userName = "112@163.com";
// password = "111111";
// ecb_user = K(userName);
// ecb_passwd = encodeURI(H(password, F(K(userName))));


// console.log("账号：", ecb_user);
// console.log("密码：", ecb_passwd);
// console.log("comParam_curTime：", comParam_curTime);
// console.log("comParam_seqCode：", comParam_seqCode);
// console.log("comParam_signature：", comParam_signature);

function data(userName, password) {
    n = (new Date).getTime()
    a = T()
    t = "s54zv9bm1vd5czfujy6nnuxj1l4g2ny6"
    comParam_curTime = n
    comParam_seqCode = a
    comParam_signature = o()(n + a + o()(a + t + n))
    return {
        "userName": K(userName),
        "password": encodeURI(H(password, F(K(userName)))),
        "referrer": "wap",
        "mainVersion": "300021100",
        "comParam_curTime": comParam_curTime,
        "comParam_seqCode": comParam_seqCode,
        "comParam_signature": comParam_signature,
        "isCheck": "true",
        "locale": "zh-cn"
    }
}


// password: encodeURI(Object(l["c"])(a.value, Object(l["f"])(Object(l["g"])(s.value))))
// password: encodeURI(H(a.value, F(K(s.value))))


